﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MotionCS.Helper;
using MotionCS.Controller;
using MotionCS.Module;
using MotionCS.Enumerate;

namespace MotionCS.Config
{
    public class MotionSystemConfi
    {
        /// <summary>
        /// 光学设备类型
        /// </summary>
        public int AoiDeviceType = 0;
        /// <summary>
        /// 运动卡类型
        /// </summary>
        public int MotionCardType = 0;
        /// <summary>
        /// 日志输出
        /// </summary>
        public int Logout;
        /// <summary>
        /// 错误输出
        /// </summary>
        public int Logerr;
    }

    public class DInputConfi
    {
        /// <summary>
        /// 启动按钮
        /// </summary>
        public int Start = -1;
        /// <summary>
        /// 停止按钮
        /// </summary>
        public int Stop = -1;
        /// <summary>
        /// 复位按钮
        /// </summary>
        public int Reset = -1;
        /// <summary>
        /// 安全门
        /// </summary>
        public int SafeDoor = -1;
        /// <summary>
        /// 急停按钮
        /// </summary>
        public int EmgStop = -1;
        /// <summary>
        /// 气压检测
        /// </summary>
        public int Pressure = -1;
        /// <summary>
        /// 输送带1传感器1
        /// </summary>
        public int T1Sensor1 = -1;
        /// <summary>
        /// 输送带1感应器2
        /// </summary>
        public int T1Sensor2 = -1;
        /// <summary>
        /// 输送带1感应器3
        /// </summary>
        public int T1Sensor3 = -1;
        /// <summary>
        /// 输送带1感应器4
        /// </summary>
        public int T1Sensor4 = -1;
        /// <summary>
        /// 输送带1上游有板
        /// </summary>
        public int T1FrontReady = -1;
        /// <summary>
        /// 输送带1下游要板
        /// </summary>
        public int T1AfterReady = -1;
        /// <summary>
        /// 输送带1直通模式
        /// </summary>
        public int T1PassMode = -1;
        /// <summary>
        /// 输送带1传感器1
        /// </summary>
        public int T2Sensor1 = -1;
        /// <summary>
        /// 输送带1感应器2
        /// </summary>
        public int T2Sensor2 = -1;
        /// <summary>
        /// 输送带1感应器3
        /// </summary>
        public int T2Sensor3 = -1;
        /// <summary>
        /// 输送带1感应器4
        /// </summary>
        public int T2Sensor4 = -1;
        /// <summary>
        /// 输送带1上游有板
        /// </summary>
        public int T2FrontReady = -1;
        /// <summary>
        /// 输送带1下游要板
        /// </summary>
        public int T2AfterReady = -1;
        /// <summary>
        /// 输送带1直通模式
        /// </summary>
        public int T2PassMode = -1;
    }

    public class DOutputConfi
    {
        /// <summary>
        /// 相机1补光灯红
        /// </summary>
        public int CameraUpStrobeR = -1;
        /// <summary>
        /// 相机1补光灯绿
        /// </summary>
        public int CameraUpStrobeG = -1;
        /// <summary>
        /// 相机1补光灯蓝
        /// </summary>
        public int CameraUpStrobeB = -1;
        /// <summary>
        /// 相机1补光灯白
        /// </summary>
        public int CameraUpStrobeW = -1;
        /// <summary>
        /// 相机1触发拍照
        /// </summary>
        public int CameraUpTrigger = -1;
        /// <summary>
        /// 相机1左光机
        /// </summary>
        public int CameraUpLeftDlp = -1;
        /// <summary>
        /// 相机1前光机
        /// </summary>
        public int CameraUpFrontDlp = -1;
        /// <summary>
        /// 相机1右光机
        /// </summary>
        public int CameraUpRightDlp = -1;
        /// <summary>
        /// 相机1后光机
        /// </summary>
        public int CameraUpBackDlp = -1;
        /// <summary>
        /// 相机2补光灯红
        /// </summary>
        public int CameraDownStrobeR = -1;
        /// <summary>
        /// 相机2补光灯绿
        /// </summary>
        public int CameraDownStrobeG = -1;
        /// <summary>
        /// 相机2补光灯蓝
        /// </summary>
        public int CameraDownStrobeB = -1;
        /// <summary>
        /// 相机2补光灯白
        /// </summary>
        public int CameraDownStrobeW = -1;
        /// <summary>
        /// 相机2触发信号
        /// </summary>
        public int CameraDownTrigger = -1;
        /// <summary>
        /// 相机1左光机
        /// </summary>
        public int CameraDownLeftDlp = -1;
        /// <summary>
        /// 相机1前光机
        /// </summary>
        public int CameraDownFrontDlp = -1;
        /// <summary>
        /// 相机1右光机
        /// </summary>
        public int CameraDownRightDlp = -1;
        /// <summary>
        /// 相机1后光机
        /// </summary>
        public int CameraDownBackDlp = -1;
        /// <summary>
        /// 输送带1气缸1
        /// </summary>
        public int T1Cylinder1 = -1;
        /// <summary>
        /// 输送带1锁紧气缸
        /// </summary>
        public int T1Cylinder2 = -1;
        /// <summary>
        /// 输送带1右阻挡气缸
        /// </summary>
        public int T1Cylinder3 = -1;
        /// <summary>
        /// 输送带1上游就绪
        /// </summary>
        public int T1FrontReady = -1;
        /// <summary>
        /// 输送带1下游就绪
        /// </summary>
        public int T1AfterReady = -1;
        /// <summary>
        /// 输送带1检测结果
        /// </summary>
        public int T1CheckResult = -1;
        /// <summary>
        /// 输送带1状态灯红
        /// </summary>
        public int T1StatusR = -1;
        /// <summary>
        /// 输送带1状态灯绿
        /// </summary>
        public int T1StatusG = -1;
        /// <summary>
        /// 输送带1状态灯黄
        /// </summary>
        public int T1StatusY = -1;
        /// <summary>
        /// 输送带1报警蜂鸣器
        /// </summary>
        public int T1AlmBeep = -1;
        /// <summary>
        /// 输送带2气缸1
        /// </summary>
        public int T2Cylinder1 = -1;
        /// <summary>
        /// 输送带2气缸2
        /// </summary>
        public int T2Cylinder2 = -1;
        /// <summary>
        /// 输送带2气缸3
        /// </summary>
        public int T2Cylinder3 = -1;
        /// <summary>
        /// 输送带1上游就绪
        /// </summary>
        public int T2FrontReady = -1;
        /// <summary>
        /// 输送带1下游就绪
        /// </summary>
        public int T2AfterReady = -1;
        /// <summary>
        /// 输送带1检测结果
        /// </summary>
        public int T2CheckResult = -1;
        /// <summary>
        /// 输送带2状态灯红
        /// </summary>
        public int T2StatusR = -1;
        /// <summary>
        /// 输送带2状态灯绿
        /// </summary>
        public int T2StatusG = -1;
        /// <summary>
        /// 输送带2状态灯黄
        /// </summary>
        public int T2StatusY = -1;
        /// <summary>
        /// 输送带2报警蜂鸣器
        /// </summary>
        public int T2AlmBeep = -1;
    }

    public class CalibrationConfi
    {
        /// <summary>
        /// 步距X
        /// </summary>
        public float StepX;
        /// <summary>
        /// 步距Y
        /// </summary>
        public float StepY;
        /// <summary>
        /// 前轨左进板起点X
        /// </summary>
        public float FrontLStartX;
        /// <summary>
        /// 前轨左进板起点Y
        /// </summary>
        public float FrontLStartY;
        /// <summary>
        /// 前轨右进板起点X
        /// </summary>
        public float FrontRStartX;
        /// <summary>
        /// 前轨右进板起点Y
        /// </summary>
        public float FrontRStartY;
        /// <summary>
        /// 后轨左进板起点X
        /// </summary>
        public float BackLStartX;
        /// <summary>
        /// 后轨左进板起点Y
        /// </summary>
        public float BackLStartY;
        /// <summary>
        /// 后轨右进板起点X
        /// </summary>
        public float BackRStartX;
        /// <summary>
        /// 后轨右进板起点Y
        /// </summary>
        public float BackRStartY;
        /// <summary>
        /// 左进板基点X
        /// </summary>
        public float LBaseX;
        /// <summary>
        /// 左进板基点Y
        /// </summary>
        public float LBaseY;
        /// <summary>
        /// 右进板基点X
        /// </summary>
        public float RBaseX;
        /// <summary>
        /// 右进板基点Y
        /// </summary>
        public float RBaseY;
    }

    /// <summary>
    /// 相机模组配置
    /// </summary>
    public class CameraConfi
    {
        /// <summary>
        /// 使能状态
        /// </summary>
        public int Enable;
        /// <summary>
        /// 标定配置
        /// </summary>
        public CalibrationConfi calibration;
        /// <summary>
        /// 相机标识
        /// </summary>
        public int Identity;
        /// <summary>
        /// 相机类型
        /// </summary>
        public int CameraType;
        /// <summary>
        /// 相机颜色
        /// </summary>
        public int CameraColor;
        /// <summary>
        /// 取像模式
        /// </summary>
        public int GrabMode;
        /// <summary>
        /// 左光机取像数量
        /// </summary>
        public int LeftDlpGrabNum;
        /// <summary>
        /// 前光机取像数量
        /// </summary>
        public int FrontDlpGrabNum;
        /// <summary>
        /// 右光机取像数量
        /// </summary>
        public int RightDlpGrabNum;
        /// <summary>
        /// 后光机取像数量
        /// </summary>
        public int BackDlpGrabNum;
        /// <summary>
        /// 超时时长
        /// </summary>
        public int Timeout;
    }
    /// <summary>
    /// 输送带模组配置
    /// </summary>
    public class ConveyorConfi
    {
        /// <summary>
        /// 使能状态
        /// </summary>
        public int Enable;
        /// <summary>
        /// 工作模式 0-在线   1-离线
        /// </summary>
        public int LineMode;
        /// <summary>
        /// 进板方向 0-左进板  1-右进板
        /// </summary>
        public int Direction;
        /// <summary>
        /// 检测结果模式
        /// </summary>
        public int SmemaMode;
        /// <summary>
        /// 超时时长
        /// </summary>
        public int Timeout;
        /// <summary>
        /// 固定调宽轴 0-轴3 1-轴4
        /// </summary>
        public int WAxisFixed;
        /// <summary>
        /// 调宽轴位置
        /// </summary>
        public float WAxisPosition;
        /// <summary>
        /// 调宽轴校准
        /// </summary>
        public float WAxisCheck;
        /// <summary>
        /// 读码器配置
        /// </summary>
        public CodeReaderConfi ReaderConfi;
    }
    /// <summary>
    /// 硬件配置
    /// </summary>
    public class HardwareConfi : SingleObjectBase<HardwareConfi>
    {
        /// <summary>
        /// 运动卡配置
        /// </summary>
        public MotionSystemConfi MotionConfi;
        /// <summary>
        /// 数字输入配置
        /// </summary>
        public DInputConfi DInConfi;
        /// <summary>
        /// 数字输出配置
        /// </summary>
        public DOutputConfi DOutConfi;
        /// <summary>
        /// 前轨输送带配置
        /// </summary>
        public AxisConfi TAxisFrontConfi;
        /// <summary>
        /// 后轨输送带配置
        /// </summary>
        public AxisConfi TAxisBackConfi;
        /// <summary>
        /// 前轨调宽轴配置
        /// </summary>
        public AxisConfi WAxisFrontConfi;
        /// <summary>
        /// 后轨调宽轴配置
        /// </summary>
        public AxisConfi WAxisBack1Confi;
        /// <summary>
        /// 后轨调宽轴配置
        /// </summary>
        public AxisConfi WAxisBack2Confi;
        /// <summary>
        /// 上照相机X配置
        /// </summary>
        public AxisConfi XAxisUpConfi;
        /// <summary>
        /// 上照相机Y配置
        /// </summary>
        public AxisConfi YAxisUpConfi;
        /// <summary>
        /// 下照相机X配置
        /// </summary>
        public AxisConfi XAxisDownConfi;
        /// <summary>
        /// 下照相机Y配置
        /// </summary>
        public AxisConfi YAxisDownConfi;
        /// <summary>
        /// 上照相机配置
        /// </summary>
        public CameraConfi CameraUpConfi;
        /// <summary>
        /// 下照相机配置
        /// </summary>
        public CameraConfi CameraDownConfi;
        /// <summary>
        /// 前轨输送带配置
        /// </summary>
        public ConveyorConfi ConveyorFrontConfi;
        /// <summary>
        /// 后轨输送带配置
        /// </summary>
        public ConveyorConfi ConveyorBackConfi;
        /// <summary>
        /// 构造函数
        /// </summary>
        public HardwareConfi()
        {
            MotionConfi = new MotionSystemConfi();
            DInConfi = new DInputConfi();
            DOutConfi = new DOutputConfi();
            TAxisFrontConfi = new AxisConfi()
            {
                Identity = AxisEnum.T_Front,
                Name = "前轨传送轴",
                MualSpeed = 100,
                MualAccel = 200f,
                MualDecel = 200f,
                AutoSpeed = 100,
                AutoAccel = 200f,
                AutoDecel = 200f,
                Sramp = 0.02f,
                HomeMode = -1,
            };

            TAxisBackConfi = new AxisConfi()
            {
                Identity = AxisEnum.T_Back,
                Name = "后轨传送轴",
                MualSpeed = 100,
                MualAccel = 200f,
                MualDecel = 200f,
                AutoSpeed = 100,
                AutoAccel = 200f,
                AutoDecel = 200f,
                Sramp = 0.02f,
                HomeMode = -1,
            };

            WAxisFrontConfi = new AxisConfi()
            {
                Identity = AxisEnum.W_Front,
                Name = "前轨调宽轴",
                MualSpeed = 20,
                MualAccel = 200f,
                MualDecel = 200f,
                AutoSpeed = 40,
                AutoAccel = 400f,
                AutoDecel = 400f,
                HomeSpeedH = 20,
                HomeSpeedL = 5,
                HomeAccel = 200f,
                HomeDecel = 200f,
                Sramp = 0.02f,
                FsLimit = 462,
                RsLimit = -14
            };

            WAxisBack1Confi = new AxisConfi()
            {
                Identity = AxisEnum.W_Back1,
                Name = "后轨调宽轴1",
                MualSpeed = 20,
                MualAccel = 200f,
                MualDecel = 200f,
                AutoSpeed = 40,
                AutoAccel = 400f,
                AutoDecel = 400f,
                HomeSpeedH = 20,
                HomeSpeedL = 5,
                HomeAccel = 200f,
                HomeDecel = 200f,
                Sramp = 0.02f,
                FsLimit = 462,
                RsLimit = -14
            };

            WAxisBack2Confi = new AxisConfi()
            {
                Identity = AxisEnum.W_Back2,
                Name = "后轨调宽轴2",
                MualSpeed = 20,
                MualAccel = 200f,
                MualDecel = 200f,
                AutoSpeed = 40,
                AutoAccel = 400f,
                AutoDecel = 400f,
                HomeSpeedH = 20,
                HomeSpeedL = 5,
                HomeAccel = 200f,
                HomeDecel = 200f,
                Sramp = 0.02f,
                FsLimit = 462,
                RsLimit = -14
            };


            XAxisUpConfi = new AxisConfi()
            {
                Identity = AxisEnum.X_Up,
                Name = "上照X轴",
                MualSpeed = 20,
                MualAccel = 200f,
                MualDecel = 200f,
                AutoSpeed = 400,
                AutoAccel = 4000f,
                AutoDecel = 4000f,
                HomeSpeedH = 60,
                HomeSpeedL = 5,
                HomeAccel = 800f,
                HomeDecel = 800f,
                Sramp = 0.02f,
                FsLimit = 525,
                RsLimit = -8
            };

            YAxisUpConfi = new AxisConfi()
            {
                Identity = AxisEnum.Y_Up,
                Name = "上照Y轴",
                MualSpeed = 20,
                MualAccel = 200f,
                MualDecel = 200f,
                AutoSpeed = 400,
                AutoAccel = 4000f,
                AutoDecel = 4000f,
                HomeSpeedH = 60,
                HomeSpeedL = 5,
                HomeAccel = 800f,
                HomeDecel = 800f,
                Sramp = 0.1f,
                FsLimit = 730,
                RsLimit = -8
            };

            XAxisDownConfi = new AxisConfi()
            {
                Identity = AxisEnum.X_Down,
                Name = "下照X轴",
                MualSpeed = 20,
                MualAccel = 200f,
                MualDecel = 200f,
                AutoSpeed = 400,
                AutoAccel = 4000f,
                AutoDecel = 4000f,
                HomeSpeedH = 60,
                HomeSpeedL = 5,
                HomeAccel = 800f,
                HomeDecel = 800f,
                Sramp = 0.02f,
                FsLimit = 525,
                RsLimit = -8
            };

            YAxisDownConfi = new AxisConfi()
            {
                Identity = AxisEnum.Y_Down,
                Name = "下照Y轴",
                MualSpeed = 20,
                MualAccel = 200f,
                MualDecel = 200f,
                AutoSpeed = 400,
                AutoAccel = 4000f,
                AutoDecel = 4000f,
                HomeSpeedH = 60,
                HomeSpeedL = 5,
                HomeAccel = 800f,
                HomeDecel = 800f,
                Sramp = 0.1f,
                FsLimit = 730,
                RsLimit = -8
            };

            CameraUpConfi = new CameraConfi()
            {
                calibration = new CalibrationConfi()
                {
                    StepX = 40f,
                    StepY = 28f,
                    FrontLStartX = 490,
                    FrontLStartY = 705,
                    FrontRStartX = 10,
                    FrontRStartY = 492,
                    BackLStartX = 10,
                    BackLStartY = 10,
                    BackRStartX = 10,
                    BackRStartY = 10,
                    LBaseX = 450,
                    LBaseY = 250,
                    RBaseX = 50,
                    RBaseY = 250
                } 
            };

            CameraDownConfi = new CameraConfi()
            {
                calibration = new CalibrationConfi() {
                    StepX = 40f,
                    StepY = 28f,
                    FrontLStartX = 490,
                    FrontLStartY = 705,
                    FrontRStartX = 10,
                    FrontRStartY = 492,
                    BackLStartX = 10,
                    BackLStartY = 10,
                    BackRStartX = 10,
                    BackRStartY = 10,
                    LBaseX = 450,
                    LBaseY = 250,
                    RBaseX = 50,
                    RBaseY = 250
                }
            };

            ConveyorFrontConfi = new ConveyorConfi()
            {
                LineMode = 0,
                Direction = 0,
                Timeout = 10,
                ReaderConfi = new CodeReaderConfi()
                {
                    ReaderEnable = 0,
                    SerialName = "COM1",
                    BaudRate = 9600,
                    DataBits = 8,
                    Parity = 0,
                    StopBits = 1,
                    ProtocolType = 0,
                    TriggerMode = 0,
                    TriggerOn = "",
                    TriggerOff = "",
                    ErrorStr = ""
                }
            };

            ConveyorBackConfi = new ConveyorConfi()
            {
                LineMode = 0,
                Direction = 0,
                Timeout = 10,
                ReaderConfi = new CodeReaderConfi()
                {
                    ReaderEnable = 0,
                    SerialName = "COM1",
                    BaudRate = 9600,
                    DataBits = 8,
                    Parity = 0,
                    StopBits = 1,
                    ProtocolType = 0,
                    TriggerMode = 0,
                    TriggerOn = "",
                    TriggerOff = "",
                    ErrorStr = ""
                }
            };

            InitConfi();
        }
        /// <summary>
        /// 加载配置
        /// </summary>
        /// <returns></returns>
        public void InitConfi()
        {
            ConfigHelper.Instance.Init();

            MotionConfi.AoiDeviceType = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(MotionSystemConfi), nameof(MotionConfi.AoiDeviceType), MotionConfi.AoiDeviceType.ToString()));
            MotionConfi.MotionCardType = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(MotionSystemConfi), nameof(MotionConfi.MotionCardType), MotionConfi.MotionCardType.ToString()));
            MotionConfi.Logout = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(MotionSystemConfi), nameof(MotionConfi.Logout), MotionConfi.Logout.ToString()));
            MotionConfi.Logerr = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(MotionSystemConfi), nameof(MotionConfi.Logerr), MotionConfi.Logerr.ToString()));

            DInConfi.Start = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.Start), DInConfi.Start.ToString()));
            DInConfi.Stop = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.Stop), DInConfi.Stop.ToString()));
            DInConfi.Reset = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.Reset), DInConfi.Reset.ToString()));
            DInConfi.SafeDoor = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.SafeDoor), DInConfi.SafeDoor.ToString()));
            DInConfi.EmgStop = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.EmgStop), DInConfi.EmgStop.ToString()));
            DInConfi.Pressure = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.Pressure), DInConfi.Pressure.ToString()));
            DInConfi.T1Sensor1 = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.T1Sensor1), DInConfi.T1Sensor1.ToString()));
            DInConfi.T1Sensor2 = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.T1Sensor2), DInConfi.T1Sensor2.ToString()));
            DInConfi.T1Sensor3 = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.T1Sensor3), DInConfi.T1Sensor3.ToString()));
            DInConfi.T1Sensor4 = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.T1Sensor4), DInConfi.T1Sensor4.ToString()));
            DInConfi.T1FrontReady = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.T1FrontReady), DInConfi.T1FrontReady.ToString()));
            DInConfi.T1AfterReady = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.T1AfterReady), DInConfi.T1AfterReady.ToString()));
            DInConfi.T1PassMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.T1PassMode), DInConfi.T1PassMode.ToString()));
            DInConfi.T2Sensor1 = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.T2Sensor1), DInConfi.T2Sensor1.ToString()));
            DInConfi.T2Sensor2 = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.T2Sensor2), DInConfi.T2Sensor2.ToString()));
            DInConfi.T2Sensor3 = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.T2Sensor3), DInConfi.T2Sensor3.ToString()));
            DInConfi.T2Sensor4 = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.T2Sensor4), DInConfi.T2Sensor4.ToString()));
            DInConfi.T2FrontReady = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.T2FrontReady), DInConfi.T2FrontReady.ToString()));
            DInConfi.T2AfterReady = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.T2AfterReady), DInConfi.T2AfterReady.ToString()));
            DInConfi.T2PassMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DInputConfi), nameof(DInConfi.T2PassMode), DInConfi.T2PassMode.ToString()));

            DOutConfi.CameraUpStrobeR = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraUpStrobeR), DOutConfi.CameraUpStrobeR.ToString()));
            DOutConfi.CameraUpStrobeG = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraUpStrobeG), DOutConfi.CameraUpStrobeG.ToString()));
            DOutConfi.CameraUpStrobeB = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraUpStrobeB), DOutConfi.CameraUpStrobeB.ToString()));
            DOutConfi.CameraUpStrobeW = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraUpStrobeW), DOutConfi.CameraUpStrobeW.ToString()));
            DOutConfi.CameraUpTrigger = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraUpTrigger), DOutConfi.CameraUpTrigger.ToString()));
            DOutConfi.CameraUpLeftDlp = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraUpLeftDlp), DOutConfi.CameraUpLeftDlp.ToString()));
            DOutConfi.CameraUpFrontDlp = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraUpFrontDlp), DOutConfi.CameraUpFrontDlp.ToString()));
            DOutConfi.CameraUpRightDlp = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraUpRightDlp), DOutConfi.CameraUpRightDlp.ToString()));
            DOutConfi.CameraUpBackDlp = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraUpBackDlp), DOutConfi.CameraUpBackDlp.ToString()));
            DOutConfi.CameraDownStrobeR = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraDownStrobeR), DOutConfi.CameraDownStrobeR.ToString()));
            DOutConfi.CameraDownStrobeG = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraDownStrobeG), DOutConfi.CameraDownStrobeG.ToString()));
            DOutConfi.CameraDownStrobeB = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraDownStrobeB), DOutConfi.CameraDownStrobeB.ToString()));
            DOutConfi.CameraDownStrobeW = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraDownStrobeW), DOutConfi.CameraDownStrobeW.ToString()));
            DOutConfi.CameraDownTrigger = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraDownTrigger), DOutConfi.CameraDownTrigger.ToString()));
            DOutConfi.CameraDownLeftDlp = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraDownLeftDlp), DOutConfi.CameraDownLeftDlp.ToString()));
            DOutConfi.CameraDownFrontDlp = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraDownFrontDlp), DOutConfi.CameraDownFrontDlp.ToString()));
            DOutConfi.CameraDownRightDlp = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraDownRightDlp), DOutConfi.CameraDownRightDlp.ToString()));
            DOutConfi.CameraDownBackDlp = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.CameraDownBackDlp), DOutConfi.CameraDownBackDlp.ToString()));
            DOutConfi.T1Cylinder1 = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T1Cylinder1), DOutConfi.T1Cylinder1.ToString()));
            DOutConfi.T1Cylinder2 = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T1Cylinder2), DOutConfi.T1Cylinder2.ToString()));
            DOutConfi.T1Cylinder3 = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T1Cylinder3), DOutConfi.T1Cylinder3.ToString()));
            DOutConfi.T1FrontReady = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T1FrontReady), DOutConfi.T1FrontReady.ToString()));
            DOutConfi.T1AfterReady = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T1AfterReady), DOutConfi.T1AfterReady.ToString()));
            DOutConfi.T1CheckResult = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T1CheckResult), DOutConfi.T1CheckResult.ToString()));
            DOutConfi.T1StatusR = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T1StatusR), DOutConfi.T1StatusR.ToString()));
            DOutConfi.T1StatusG = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T1StatusG), DOutConfi.T1StatusG.ToString()));
            DOutConfi.T1StatusY = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T1StatusY), DOutConfi.T1StatusY.ToString()));
            DOutConfi.T1AlmBeep = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T1AlmBeep), DOutConfi.T1AlmBeep.ToString()));
            DOutConfi.T2Cylinder1 = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T2Cylinder1), DOutConfi.T2Cylinder1.ToString()));
            DOutConfi.T2Cylinder2 = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T2Cylinder2), DOutConfi.T2Cylinder2.ToString()));
            DOutConfi.T2Cylinder3 = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T2Cylinder3), DOutConfi.T2Cylinder3.ToString()));
            DOutConfi.T2FrontReady = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T2FrontReady), DOutConfi.T2FrontReady.ToString()));
            DOutConfi.T2AfterReady = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T2AfterReady), DOutConfi.T2AfterReady.ToString()));
            DOutConfi.T2CheckResult = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T2CheckResult), DOutConfi.T2CheckResult.ToString()));
            DOutConfi.T2StatusR = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T2StatusR), DOutConfi.T2StatusR.ToString()));
            DOutConfi.T2StatusG = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T2StatusG), DOutConfi.T2StatusG.ToString()));
            DOutConfi.T2StatusY = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T2StatusY), DOutConfi.T2StatusY.ToString()));
            DOutConfi.T2AlmBeep = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(DOutputConfi), nameof(DOutConfi.T2AlmBeep), DOutConfi.T2AlmBeep.ToString()));

            XAxisUpConfi.Axis = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.Axis), XAxisUpConfi.Axis.ToString()));
            XAxisUpConfi.Inp = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.Inp), XAxisUpConfi.Inp.ToString()));
            XAxisUpConfi.Alm = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.Alm), XAxisUpConfi.Alm.ToString()));
            XAxisUpConfi.OutMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.OutMode), XAxisUpConfi.OutMode.ToString()));
            XAxisUpConfi.IptMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.IptMode), XAxisUpConfi.IptMode.ToString()));
            XAxisUpConfi.OutUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.OutUnit), XAxisUpConfi.OutUnit.ToString()));
            XAxisUpConfi.IptUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.IptUnit), XAxisUpConfi.IptUnit.ToString()));
            XAxisUpConfi.MualSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.MualSpeed), XAxisUpConfi.MualSpeed.ToString()));
            XAxisUpConfi.MualAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.MualAccel), XAxisUpConfi.MualAccel.ToString()));
            XAxisUpConfi.MualDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.MualDecel), XAxisUpConfi.MualDecel.ToString()));
            XAxisUpConfi.AutoSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.AutoSpeed), XAxisUpConfi.AutoSpeed.ToString()));
            XAxisUpConfi.AutoAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.AutoAccel), XAxisUpConfi.AutoAccel.ToString()));
            XAxisUpConfi.AutoDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.AutoDecel), XAxisUpConfi.AutoDecel.ToString()));
            XAxisUpConfi.HomeMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.HomeMode), XAxisUpConfi.HomeMode.ToString()));
            XAxisUpConfi.HomeDir = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.HomeDir), XAxisUpConfi.HomeDir.ToString()));
            XAxisUpConfi.HomeSpeedH = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.HomeSpeedH), XAxisUpConfi.HomeSpeedH.ToString()));
            XAxisUpConfi.HomeSpeedL = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.HomeSpeedL), XAxisUpConfi.HomeSpeedL.ToString()));
            XAxisUpConfi.HomeAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.HomeAccel), XAxisUpConfi.HomeAccel.ToString()));
            XAxisUpConfi.HomeDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.HomeDecel), XAxisUpConfi.HomeDecel.ToString()));
            XAxisUpConfi.Sramp = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.Sramp), XAxisUpConfi.Sramp.ToString()));
            XAxisUpConfi.FsLimit = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.FsLimit), XAxisUpConfi.FsLimit.ToString()));
            XAxisUpConfi.RsLimit = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.RsLimit), XAxisUpConfi.RsLimit.ToString()));
            XAxisUpConfi.ElLevel = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.ElLevel), XAxisUpConfi.ElLevel.ToString()));
            XAxisUpConfi.MoveDir = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisUpConfi), nameof(XAxisUpConfi.MoveDir), XAxisUpConfi.MoveDir.ToString()));

            YAxisUpConfi.Axis = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.Axis), YAxisUpConfi.Axis.ToString()));
            YAxisUpConfi.Inp = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.Inp), YAxisUpConfi.Inp.ToString()));
            YAxisUpConfi.Alm = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.Alm), YAxisUpConfi.Alm.ToString()));
            YAxisUpConfi.OutMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.OutMode), YAxisUpConfi.OutMode.ToString()));
            YAxisUpConfi.IptMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.IptMode), YAxisUpConfi.IptMode.ToString()));
            YAxisUpConfi.OutUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.OutUnit), YAxisUpConfi.OutUnit.ToString()));
            YAxisUpConfi.IptUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.IptUnit), YAxisUpConfi.IptUnit.ToString()));
            YAxisUpConfi.MualSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.MualSpeed), YAxisUpConfi.MualSpeed.ToString()));
            YAxisUpConfi.MualAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.MualAccel), YAxisUpConfi.MualAccel.ToString()));
            YAxisUpConfi.MualDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.MualDecel), YAxisUpConfi.MualDecel.ToString()));
            YAxisUpConfi.AutoSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.AutoSpeed), YAxisUpConfi.AutoSpeed.ToString()));
            YAxisUpConfi.AutoAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.AutoAccel), YAxisUpConfi.AutoAccel.ToString()));
            YAxisUpConfi.AutoDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.AutoDecel), YAxisUpConfi.AutoDecel.ToString()));
            YAxisUpConfi.HomeMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.HomeMode), YAxisUpConfi.HomeMode.ToString()));
            YAxisUpConfi.HomeDir = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.HomeDir), YAxisUpConfi.HomeDir.ToString()));
            YAxisUpConfi.HomeSpeedH = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.HomeSpeedH), YAxisUpConfi.HomeSpeedH.ToString()));
            YAxisUpConfi.HomeSpeedL = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.HomeSpeedL), YAxisUpConfi.HomeSpeedL.ToString()));
            YAxisUpConfi.HomeAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.HomeAccel), YAxisUpConfi.HomeAccel.ToString()));
            YAxisUpConfi.HomeDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.HomeDecel), YAxisUpConfi.HomeDecel.ToString()));
            YAxisUpConfi.Sramp = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.Sramp), YAxisUpConfi.Sramp.ToString()));
            YAxisUpConfi.FsLimit = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.FsLimit), YAxisUpConfi.FsLimit.ToString()));
            YAxisUpConfi.RsLimit = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.RsLimit), YAxisUpConfi.RsLimit.ToString()));
            YAxisUpConfi.ElLevel = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.ElLevel), YAxisUpConfi.ElLevel.ToString()));
            YAxisUpConfi.MoveDir = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisUpConfi), nameof(YAxisUpConfi.MoveDir), YAxisUpConfi.MoveDir.ToString()));

            TAxisFrontConfi.Axis = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(TAxisFrontConfi), nameof(TAxisFrontConfi.Axis), TAxisFrontConfi.Axis.ToString()));
            TAxisFrontConfi.OutMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(TAxisFrontConfi), nameof(TAxisFrontConfi.OutMode), TAxisFrontConfi.OutMode.ToString()));
            TAxisFrontConfi.IptMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(TAxisFrontConfi), nameof(TAxisFrontConfi.IptMode), TAxisFrontConfi.IptMode.ToString()));
            TAxisFrontConfi.OutUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(TAxisFrontConfi), nameof(TAxisFrontConfi.OutUnit), TAxisFrontConfi.OutUnit.ToString()));
            TAxisFrontConfi.IptUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(TAxisFrontConfi), nameof(TAxisFrontConfi.IptUnit), TAxisFrontConfi.IptUnit.ToString()));
            TAxisFrontConfi.MualSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(TAxisFrontConfi), nameof(TAxisFrontConfi.MualSpeed), TAxisFrontConfi.MualSpeed.ToString()));
            TAxisFrontConfi.MualAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(TAxisFrontConfi), nameof(TAxisFrontConfi.MualAccel), TAxisFrontConfi.MualAccel.ToString()));
            TAxisFrontConfi.MualDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(TAxisFrontConfi), nameof(TAxisFrontConfi.MualDecel), TAxisFrontConfi.MualDecel.ToString()));
            TAxisFrontConfi.AutoSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(TAxisFrontConfi), nameof(TAxisFrontConfi.AutoSpeed), TAxisFrontConfi.AutoSpeed.ToString()));
            TAxisFrontConfi.AutoAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(TAxisFrontConfi), nameof(TAxisFrontConfi.AutoAccel), TAxisFrontConfi.AutoAccel.ToString()));
            TAxisFrontConfi.AutoDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(TAxisFrontConfi), nameof(TAxisFrontConfi.AutoDecel), TAxisFrontConfi.AutoDecel.ToString()));
            TAxisFrontConfi.Sramp = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(TAxisFrontConfi), nameof(TAxisFrontConfi.Sramp), TAxisFrontConfi.Sramp.ToString()));
            TAxisFrontConfi.MoveDir = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(TAxisFrontConfi), nameof(TAxisFrontConfi.MoveDir), TAxisFrontConfi.MoveDir.ToString()));

            WAxisFrontConfi.Axis = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.Axis), WAxisFrontConfi.Axis.ToString()));
            WAxisFrontConfi.Inp = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.Inp), WAxisFrontConfi.Inp.ToString()));
            WAxisFrontConfi.Alm = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.Alm), WAxisFrontConfi.Alm.ToString()));
            WAxisFrontConfi.OutMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.OutMode), TAxisFrontConfi.OutMode.ToString()));
            WAxisFrontConfi.IptMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.IptMode), TAxisFrontConfi.IptMode.ToString()));
            WAxisFrontConfi.OutUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.OutUnit), TAxisFrontConfi.OutUnit.ToString()));
            WAxisFrontConfi.IptUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.IptUnit), TAxisFrontConfi.IptUnit.ToString()));
            WAxisFrontConfi.MualSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.MualSpeed), WAxisFrontConfi.MualSpeed.ToString()));
            WAxisFrontConfi.MualAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.MualAccel), WAxisFrontConfi.MualAccel.ToString()));
            WAxisFrontConfi.MualDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.MualDecel), WAxisFrontConfi.MualDecel.ToString()));
            WAxisFrontConfi.AutoSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.AutoSpeed), WAxisFrontConfi.AutoSpeed.ToString()));
            WAxisFrontConfi.AutoAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.AutoAccel), WAxisFrontConfi.AutoAccel.ToString()));
            WAxisFrontConfi.AutoDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.AutoDecel), WAxisFrontConfi.AutoDecel.ToString()));
            WAxisFrontConfi.HomeMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.HomeMode), WAxisFrontConfi.HomeMode.ToString()));
            WAxisFrontConfi.HomeDir = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.HomeDir), WAxisFrontConfi.HomeDir.ToString()));
            WAxisFrontConfi.HomeSpeedH = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.HomeSpeedH), WAxisFrontConfi.HomeSpeedH.ToString()));
            WAxisFrontConfi.HomeSpeedL = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.HomeSpeedL), WAxisFrontConfi.HomeSpeedL.ToString()));
            WAxisFrontConfi.HomeAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.HomeAccel), WAxisFrontConfi.HomeAccel.ToString()));
            WAxisFrontConfi.HomeDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.HomeDecel), WAxisFrontConfi.HomeDecel.ToString()));
            WAxisFrontConfi.Sramp = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.Sramp), WAxisFrontConfi.Sramp.ToString()));
            WAxisFrontConfi.FsLimit = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.FsLimit), WAxisFrontConfi.FsLimit.ToString()));
            WAxisFrontConfi.RsLimit = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.RsLimit), WAxisFrontConfi.RsLimit.ToString()));
            WAxisFrontConfi.ElLevel = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.ElLevel), WAxisFrontConfi.ElLevel.ToString()));
            WAxisFrontConfi.MoveDir = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.MoveDir), WAxisFrontConfi.MoveDir.ToString()));

            XAxisDownConfi.Axis = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.Axis), XAxisDownConfi.Axis.ToString()));
            XAxisDownConfi.Inp = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.Inp), XAxisDownConfi.Inp.ToString()));
            XAxisDownConfi.Alm = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.Alm), XAxisDownConfi.Alm.ToString()));
            XAxisDownConfi.OutMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.OutMode), XAxisDownConfi.OutMode.ToString()));
            XAxisDownConfi.IptMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.IptMode), XAxisDownConfi.IptMode.ToString()));
            XAxisDownConfi.OutUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.OutUnit), XAxisDownConfi.OutUnit.ToString()));
            XAxisDownConfi.IptUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.IptUnit), XAxisDownConfi.IptUnit.ToString()));
            XAxisDownConfi.MualSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.MualSpeed), XAxisDownConfi.MualSpeed.ToString()));
            XAxisDownConfi.MualAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.MualAccel), XAxisDownConfi.MualAccel.ToString()));
            XAxisDownConfi.MualDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.MualDecel), XAxisDownConfi.MualDecel.ToString()));
            XAxisDownConfi.AutoSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.AutoSpeed), XAxisDownConfi.AutoSpeed.ToString()));
            XAxisDownConfi.AutoAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.AutoAccel), XAxisDownConfi.AutoAccel.ToString()));
            XAxisDownConfi.AutoDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.AutoDecel), XAxisDownConfi.AutoDecel.ToString()));
            XAxisDownConfi.HomeMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.HomeMode), XAxisDownConfi.HomeMode.ToString()));
            XAxisDownConfi.HomeDir = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.HomeDir), XAxisDownConfi.HomeDir.ToString()));
            XAxisDownConfi.HomeSpeedH = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.HomeSpeedH), XAxisDownConfi.HomeSpeedH.ToString()));
            XAxisDownConfi.HomeSpeedL = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.HomeSpeedL), XAxisDownConfi.HomeSpeedL.ToString()));
            XAxisDownConfi.HomeAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.HomeAccel), XAxisDownConfi.HomeAccel.ToString()));
            XAxisDownConfi.HomeDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.HomeDecel), XAxisDownConfi.HomeDecel.ToString()));
            XAxisDownConfi.Sramp = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.Sramp), XAxisDownConfi.Sramp.ToString()));
            XAxisDownConfi.FsLimit = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.FsLimit), XAxisDownConfi.FsLimit.ToString()));
            XAxisDownConfi.RsLimit = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.RsLimit), XAxisDownConfi.RsLimit.ToString()));
            XAxisDownConfi.ElLevel = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.ElLevel), XAxisDownConfi.ElLevel.ToString()));
            XAxisDownConfi.MoveDir = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(XAxisDownConfi), nameof(XAxisDownConfi.MoveDir), XAxisDownConfi.MoveDir.ToString()));

            YAxisDownConfi.Axis = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.Axis), YAxisDownConfi.Axis.ToString()));
            YAxisDownConfi.Inp = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.Inp), YAxisDownConfi.Inp.ToString()));
            YAxisDownConfi.Alm = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.Alm), YAxisDownConfi.Alm.ToString()));
            YAxisDownConfi.OutMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.OutMode), YAxisDownConfi.OutMode.ToString()));
            YAxisDownConfi.IptMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.IptMode), YAxisDownConfi.IptMode.ToString()));
            YAxisDownConfi.OutUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.OutUnit), YAxisDownConfi.OutUnit.ToString()));
            YAxisDownConfi.IptUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.IptUnit), YAxisDownConfi.IptUnit.ToString()));
            YAxisDownConfi.MualSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.MualSpeed), YAxisDownConfi.MualSpeed.ToString()));
            YAxisDownConfi.MualAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.MualAccel), YAxisDownConfi.MualAccel.ToString()));
            YAxisDownConfi.MualDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.MualDecel), YAxisDownConfi.MualDecel.ToString()));
            YAxisDownConfi.AutoSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.AutoSpeed), YAxisDownConfi.AutoSpeed.ToString()));
            YAxisDownConfi.AutoAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.AutoAccel), YAxisDownConfi.AutoAccel.ToString()));
            YAxisDownConfi.AutoDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.AutoDecel), YAxisDownConfi.AutoDecel.ToString()));
            YAxisDownConfi.HomeMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.HomeMode), YAxisDownConfi.HomeMode.ToString()));
            YAxisDownConfi.HomeDir = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.HomeDir), YAxisDownConfi.HomeDir.ToString()));
            YAxisDownConfi.HomeSpeedH = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.HomeSpeedH), YAxisDownConfi.HomeSpeedH.ToString()));
            YAxisDownConfi.HomeSpeedL = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.HomeSpeedL), YAxisDownConfi.HomeSpeedL.ToString()));
            YAxisDownConfi.HomeAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.HomeAccel), YAxisDownConfi.HomeAccel.ToString()));
            YAxisDownConfi.HomeDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.HomeDecel), YAxisDownConfi.HomeDecel.ToString()));
            YAxisDownConfi.Sramp = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.Sramp), YAxisDownConfi.Sramp.ToString()));
            YAxisDownConfi.FsLimit = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.FsLimit), YAxisDownConfi.FsLimit.ToString()));
            YAxisDownConfi.RsLimit = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.RsLimit), YAxisDownConfi.RsLimit.ToString()));
            YAxisDownConfi.ElLevel = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.ElLevel), YAxisDownConfi.ElLevel.ToString()));
            YAxisDownConfi.MoveDir = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(YAxisDownConfi), nameof(YAxisDownConfi.MoveDir), YAxisDownConfi.MoveDir.ToString()));

            TAxisBackConfi.Axis = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(TAxisBackConfi), nameof(TAxisBackConfi.Axis), TAxisBackConfi.Axis.ToString()));
            TAxisBackConfi.OutMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(TAxisBackConfi), nameof(TAxisBackConfi.OutMode), TAxisBackConfi.OutMode.ToString()));
            TAxisBackConfi.IptMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(TAxisBackConfi), nameof(TAxisBackConfi.IptMode), TAxisBackConfi.IptMode.ToString()));
            TAxisBackConfi.OutUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(TAxisBackConfi), nameof(TAxisBackConfi.OutUnit), TAxisBackConfi.OutUnit.ToString()));
            TAxisBackConfi.IptUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(TAxisBackConfi), nameof(TAxisBackConfi.IptUnit), TAxisBackConfi.IptUnit.ToString()));
            TAxisBackConfi.MualSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(TAxisBackConfi), nameof(TAxisBackConfi.MualSpeed), TAxisBackConfi.MualSpeed.ToString()));
            TAxisBackConfi.MualAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(TAxisBackConfi), nameof(TAxisBackConfi.MualAccel), TAxisBackConfi.MualAccel.ToString()));
            TAxisBackConfi.MualDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(TAxisBackConfi), nameof(TAxisBackConfi.MualDecel), TAxisBackConfi.MualDecel.ToString()));
            TAxisBackConfi.AutoSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(TAxisBackConfi), nameof(TAxisBackConfi.AutoSpeed), TAxisBackConfi.AutoSpeed.ToString()));
            TAxisBackConfi.AutoAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(TAxisBackConfi), nameof(TAxisBackConfi.AutoAccel), TAxisBackConfi.AutoAccel.ToString()));
            TAxisBackConfi.AutoDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(TAxisBackConfi), nameof(TAxisBackConfi.AutoDecel), TAxisBackConfi.AutoDecel.ToString()));
            TAxisBackConfi.Sramp = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(TAxisBackConfi), nameof(TAxisBackConfi.Sramp), TAxisBackConfi.Sramp.ToString()));
            TAxisBackConfi.MoveDir = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(TAxisBackConfi), nameof(TAxisBackConfi.MoveDir), TAxisBackConfi.MoveDir.ToString()));

            WAxisBack1Confi.Axis = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.Axis), WAxisBack1Confi.Axis.ToString()));
            WAxisBack1Confi.OutMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.OutMode), WAxisBack1Confi.OutMode.ToString()));
            WAxisBack1Confi.IptMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.IptMode), WAxisBack1Confi.IptMode.ToString()));
            WAxisBack1Confi.OutUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.OutUnit), WAxisBack1Confi.OutUnit.ToString()));
            WAxisBack1Confi.IptUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.IptUnit), WAxisBack1Confi.IptUnit.ToString()));
            WAxisBack1Confi.MualSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.MualSpeed), WAxisBack1Confi.MualSpeed.ToString()));
            WAxisBack1Confi.MualAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.MualAccel), WAxisBack1Confi.MualAccel.ToString()));
            WAxisBack1Confi.MualDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.MualDecel), WAxisBack1Confi.MualDecel.ToString()));
            WAxisBack1Confi.AutoSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.AutoSpeed), WAxisBack1Confi.AutoSpeed.ToString()));
            WAxisBack1Confi.AutoAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.AutoAccel), WAxisBack1Confi.AutoAccel.ToString()));
            WAxisBack1Confi.AutoDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.AutoDecel), WAxisBack1Confi.AutoDecel.ToString()));
            WAxisBack1Confi.HomeMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.HomeMode), WAxisBack1Confi.HomeMode.ToString()));
            WAxisBack1Confi.HomeDir = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.HomeDir), WAxisBack1Confi.HomeDir.ToString()));
            WAxisBack1Confi.HomeSpeedH = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.HomeSpeedH), WAxisBack1Confi.HomeSpeedH.ToString()));
            WAxisBack1Confi.HomeSpeedL = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.HomeSpeedL), WAxisBack1Confi.HomeSpeedL.ToString()));
            WAxisBack1Confi.HomeAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.HomeAccel), WAxisBack1Confi.HomeAccel.ToString()));
            WAxisBack1Confi.HomeDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.HomeDecel), WAxisBack1Confi.HomeDecel.ToString()));
            WAxisBack1Confi.Sramp = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.Sramp), WAxisBack1Confi.Sramp.ToString()));
            WAxisBack1Confi.FsLimit = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.FsLimit), WAxisBack1Confi.FsLimit.ToString()));
            WAxisBack1Confi.RsLimit = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.RsLimit), WAxisBack1Confi.RsLimit.ToString()));
            WAxisBack1Confi.ElLevel = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.ElLevel), WAxisBack1Confi.ElLevel.ToString()));
            WAxisBack1Confi.MoveDir = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.MoveDir), WAxisBack1Confi.MoveDir.ToString()));

            WAxisBack2Confi.Axis = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.Axis), WAxisBack2Confi.Axis.ToString()));
            WAxisBack2Confi.OutMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.OutMode), WAxisBack2Confi.OutMode.ToString()));
            WAxisBack2Confi.IptMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.IptMode), WAxisBack2Confi.IptMode.ToString()));
            WAxisBack2Confi.OutUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.OutUnit), WAxisBack2Confi.OutUnit.ToString()));
            WAxisBack2Confi.IptUnit = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.IptUnit), WAxisBack2Confi.IptUnit.ToString()));
            WAxisBack2Confi.MualSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.MualSpeed), WAxisBack2Confi.MualSpeed.ToString()));
            WAxisBack2Confi.MualAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.MualAccel), WAxisBack2Confi.MualAccel.ToString()));
            WAxisBack2Confi.MualDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.MualDecel), WAxisBack2Confi.MualDecel.ToString()));
            WAxisBack2Confi.AutoSpeed = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.AutoSpeed), WAxisBack2Confi.AutoSpeed.ToString()));
            WAxisBack2Confi.AutoAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.AutoAccel), WAxisBack2Confi.AutoAccel.ToString()));
            WAxisBack2Confi.AutoDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.AutoDecel), WAxisBack2Confi.AutoDecel.ToString()));
            WAxisBack2Confi.HomeMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.HomeMode), WAxisBack2Confi.HomeMode.ToString()));
            WAxisBack2Confi.HomeDir = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.HomeDir), WAxisBack2Confi.HomeDir.ToString()));
            WAxisBack2Confi.HomeSpeedH = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.HomeSpeedH), WAxisBack2Confi.HomeSpeedH.ToString()));
            WAxisBack2Confi.HomeSpeedL = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.HomeSpeedL), WAxisBack2Confi.HomeSpeedL.ToString()));
            WAxisBack2Confi.HomeAccel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.HomeAccel), WAxisBack2Confi.HomeAccel.ToString()));
            WAxisBack2Confi.HomeDecel = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.HomeDecel), WAxisBack2Confi.HomeDecel.ToString()));
            WAxisBack2Confi.Sramp = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.Sramp), WAxisBack2Confi.Sramp.ToString()));
            WAxisBack2Confi.FsLimit = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.FsLimit), WAxisBack2Confi.FsLimit.ToString()));
            WAxisBack2Confi.RsLimit = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.RsLimit), WAxisBack2Confi.RsLimit.ToString()));
            WAxisBack2Confi.ElLevel = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.ElLevel), WAxisBack2Confi.ElLevel.ToString()));
            WAxisBack2Confi.MoveDir = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.MoveDir), WAxisBack2Confi.MoveDir.ToString()));

            CameraUpConfi.Enable = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.Enable), CameraUpConfi.Enable.ToString()));
            CameraUpConfi.CameraType = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.CameraType), CameraUpConfi.CameraType.ToString()));
            CameraUpConfi.CameraColor = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.CameraColor), CameraUpConfi.CameraColor.ToString()));
            CameraUpConfi.GrabMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.GrabMode), CameraUpConfi.GrabMode.ToString()));
            CameraUpConfi.LeftDlpGrabNum = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.LeftDlpGrabNum), CameraUpConfi.LeftDlpGrabNum.ToString()));
            CameraUpConfi.FrontDlpGrabNum = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.FrontDlpGrabNum), CameraUpConfi.FrontDlpGrabNum.ToString()));
            CameraUpConfi.RightDlpGrabNum = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.RightDlpGrabNum), CameraUpConfi.RightDlpGrabNum.ToString()));
            CameraUpConfi.BackDlpGrabNum = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.BackDlpGrabNum), CameraUpConfi.BackDlpGrabNum.ToString()));
            CameraUpConfi.Timeout = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.Timeout), CameraUpConfi.Timeout.ToString()));
            CameraUpConfi.calibration.StepX = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.StepX), CameraUpConfi.calibration.StepX.ToString()));
            CameraUpConfi.calibration.StepY = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.StepY), CameraUpConfi.calibration.StepY.ToString()));
            CameraUpConfi.calibration.LBaseX = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.LBaseX), CameraUpConfi.calibration.LBaseX.ToString()));
            CameraUpConfi.calibration.LBaseY = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.LBaseY), CameraUpConfi.calibration.LBaseY.ToString()));
            CameraUpConfi.calibration.RBaseX = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.RBaseX), CameraUpConfi.calibration.RBaseX.ToString()));
            CameraUpConfi.calibration.RBaseY = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.RBaseY), CameraUpConfi.calibration.RBaseY.ToString()));

            CameraUpConfi.calibration.FrontLStartX = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.FrontLStartX), CameraUpConfi.calibration.FrontLStartX.ToString()));
            CameraUpConfi.calibration.FrontLStartY = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.FrontLStartY), CameraUpConfi.calibration.FrontLStartY.ToString()));
            CameraUpConfi.calibration.FrontRStartX = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.FrontRStartX), CameraUpConfi.calibration.FrontRStartX.ToString()));
            CameraUpConfi.calibration.FrontRStartY = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.FrontRStartY), CameraUpConfi.calibration.FrontRStartY.ToString()));

            CameraUpConfi.calibration.BackLStartX = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.BackLStartX), CameraUpConfi.calibration.BackLStartX.ToString()));
            CameraUpConfi.calibration.BackLStartY = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.BackLStartY), CameraUpConfi.calibration.BackLStartY.ToString()));
            CameraUpConfi.calibration.BackRStartX = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.BackRStartX), CameraUpConfi.calibration.BackRStartX.ToString()));
            CameraUpConfi.calibration.BackRStartY = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.BackRStartY), CameraUpConfi.calibration.BackRStartY.ToString()));

            CameraDownConfi.Enable = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.Enable), CameraDownConfi.Enable.ToString()));
            CameraDownConfi.CameraType = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.CameraType), CameraDownConfi.CameraType.ToString()));
            CameraDownConfi.CameraColor = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.CameraColor), CameraDownConfi.CameraColor.ToString()));
            CameraDownConfi.GrabMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.GrabMode), CameraDownConfi.GrabMode.ToString()));
            CameraDownConfi.LeftDlpGrabNum = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.LeftDlpGrabNum), CameraDownConfi.LeftDlpGrabNum.ToString()));
            CameraDownConfi.FrontDlpGrabNum = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.FrontDlpGrabNum), CameraDownConfi.FrontDlpGrabNum.ToString()));
            CameraDownConfi.RightDlpGrabNum = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.RightDlpGrabNum), CameraDownConfi.RightDlpGrabNum.ToString()));
            CameraDownConfi.BackDlpGrabNum = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.BackDlpGrabNum), CameraDownConfi.BackDlpGrabNum.ToString()));
            CameraDownConfi.Timeout = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.Timeout), CameraDownConfi.Timeout.ToString()));
            CameraDownConfi.calibration.StepX = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.StepX), CameraDownConfi.calibration.StepX.ToString()));
            CameraDownConfi.calibration.StepY = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.StepY), CameraDownConfi.calibration.StepY.ToString()));
            CameraDownConfi.calibration.LBaseX = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.LBaseX), CameraDownConfi.calibration.LBaseX.ToString()));
            CameraDownConfi.calibration.LBaseY = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.LBaseY), CameraDownConfi.calibration.LBaseY.ToString()));
            CameraDownConfi.calibration.RBaseX = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.RBaseX), CameraDownConfi.calibration.RBaseX.ToString()));
            CameraDownConfi.calibration.RBaseY = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.RBaseY), CameraDownConfi.calibration.RBaseY.ToString()));

            CameraDownConfi.calibration.FrontLStartX = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.FrontLStartX), CameraDownConfi.calibration.FrontLStartX.ToString()));
            CameraDownConfi.calibration.FrontLStartY = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.FrontLStartY), CameraDownConfi.calibration.FrontLStartY.ToString()));
            CameraDownConfi.calibration.FrontRStartX = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.FrontRStartX), CameraDownConfi.calibration.FrontRStartX.ToString()));
            CameraDownConfi.calibration.FrontRStartY = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.FrontRStartY), CameraDownConfi.calibration.FrontRStartY.ToString()));

            CameraDownConfi.calibration.BackLStartX = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.BackLStartX), CameraDownConfi.calibration.BackLStartX.ToString()));
            CameraDownConfi.calibration.BackLStartY = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.BackLStartY), CameraDownConfi.calibration.BackLStartY.ToString()));
            CameraDownConfi.calibration.BackRStartX = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.BackRStartX), CameraDownConfi.calibration.BackRStartX.ToString()));
            CameraDownConfi.calibration.BackRStartY = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.BackRStartY), CameraDownConfi.calibration.BackRStartY.ToString()));

            ConveyorFrontConfi.Enable = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.Enable), ConveyorFrontConfi.Enable.ToString()));
            ConveyorFrontConfi.LineMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.LineMode), ConveyorFrontConfi.LineMode.ToString()));
            ConveyorFrontConfi.Direction = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.Direction), ConveyorFrontConfi.Direction.ToString()));
            ConveyorFrontConfi.SmemaMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.SmemaMode), ConveyorFrontConfi.SmemaMode.ToString()));
            ConveyorFrontConfi.Timeout = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.Timeout), ConveyorFrontConfi.Timeout.ToString()));
            ConveyorFrontConfi.WAxisFixed = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.WAxisFixed), ConveyorFrontConfi.WAxisFixed.ToString()));
            ConveyorFrontConfi.WAxisPosition = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.WAxisPosition), ConveyorFrontConfi.WAxisPosition.ToString()));
            ConveyorFrontConfi.WAxisCheck = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.WAxisCheck), ConveyorFrontConfi.WAxisCheck.ToString()));
            ConveyorFrontConfi.ReaderConfi.ReaderEnable = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.ReaderConfi.ReaderEnable), ConveyorFrontConfi.ReaderConfi.ReaderEnable.ToString()));
            ConveyorFrontConfi.ReaderConfi.SerialName = ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.ReaderConfi.SerialName), ConveyorFrontConfi.ReaderConfi.SerialName);
            ConveyorFrontConfi.ReaderConfi.BaudRate = Convert.ToUInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.ReaderConfi.BaudRate), ConveyorFrontConfi.ReaderConfi.BaudRate.ToString()));
            ConveyorFrontConfi.ReaderConfi.DataBits = Convert.ToUInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.ReaderConfi.DataBits), ConveyorFrontConfi.ReaderConfi.DataBits.ToString()));
            ConveyorFrontConfi.ReaderConfi.Parity = Convert.ToUInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.ReaderConfi.Parity), ConveyorFrontConfi.ReaderConfi.Parity.ToString()));
            ConveyorFrontConfi.ReaderConfi.StopBits = Convert.ToUInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.ReaderConfi.StopBits), ConveyorFrontConfi.ReaderConfi.StopBits.ToString()));
            ConveyorFrontConfi.ReaderConfi.ProtocolType = Convert.ToUInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.ReaderConfi.ProtocolType), ConveyorFrontConfi.ReaderConfi.ProtocolType.ToString()));
            ConveyorFrontConfi.ReaderConfi.TriggerMode = Convert.ToUInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.ReaderConfi.TriggerMode), ConveyorFrontConfi.ReaderConfi.TriggerMode.ToString()));
            ConveyorFrontConfi.ReaderConfi.TriggerOn = ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.ReaderConfi.TriggerOn), ConveyorFrontConfi.ReaderConfi.TriggerOn);
            ConveyorFrontConfi.ReaderConfi.TriggerOff = ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.ReaderConfi.TriggerOff), ConveyorFrontConfi.ReaderConfi.TriggerOff);
            ConveyorFrontConfi.ReaderConfi.ErrorStr = ConfigHelper.Instance.GetValue(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.ReaderConfi.ErrorStr), ConveyorFrontConfi.ReaderConfi.ErrorStr);

            ConveyorBackConfi.Enable = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.Enable), ConveyorBackConfi.Enable.ToString()));
            ConveyorBackConfi.LineMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.LineMode), ConveyorBackConfi.LineMode.ToString()));
            ConveyorBackConfi.Direction = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.Direction), ConveyorBackConfi.Direction.ToString()));
            ConveyorBackConfi.SmemaMode = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.SmemaMode), ConveyorBackConfi.SmemaMode.ToString()));
            ConveyorBackConfi.Timeout = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.Timeout), ConveyorBackConfi.Timeout.ToString()));
            ConveyorBackConfi.WAxisFixed = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.WAxisFixed), ConveyorBackConfi.WAxisFixed.ToString()));
            ConveyorBackConfi.WAxisPosition = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.WAxisPosition), ConveyorBackConfi.WAxisPosition.ToString()));
            ConveyorBackConfi.WAxisCheck = Convert.ToSingle(ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.WAxisCheck), ConveyorBackConfi.WAxisCheck.ToString()));
            ConveyorBackConfi.ReaderConfi.ReaderEnable = Convert.ToInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.ReaderConfi.ReaderEnable), ConveyorBackConfi.ReaderConfi.ReaderEnable.ToString()));
            ConveyorBackConfi.ReaderConfi.SerialName = ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.ReaderConfi.SerialName), ConveyorBackConfi.ReaderConfi.SerialName);
            ConveyorBackConfi.ReaderConfi.BaudRate = Convert.ToUInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.ReaderConfi.BaudRate), ConveyorBackConfi.ReaderConfi.BaudRate.ToString()));
            ConveyorBackConfi.ReaderConfi.DataBits = Convert.ToUInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.ReaderConfi.DataBits), ConveyorBackConfi.ReaderConfi.DataBits.ToString()));
            ConveyorBackConfi.ReaderConfi.Parity = Convert.ToUInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.ReaderConfi.Parity), ConveyorBackConfi.ReaderConfi.Parity.ToString()));
            ConveyorBackConfi.ReaderConfi.StopBits = Convert.ToUInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.ReaderConfi.StopBits), ConveyorBackConfi.ReaderConfi.StopBits.ToString()));
            ConveyorBackConfi.ReaderConfi.ProtocolType = Convert.ToUInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.ReaderConfi.ProtocolType), ConveyorBackConfi.ReaderConfi.ProtocolType.ToString()));
            ConveyorBackConfi.ReaderConfi.TriggerMode = Convert.ToUInt32(ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.ReaderConfi.TriggerMode), ConveyorBackConfi.ReaderConfi.TriggerMode.ToString()));
            ConveyorBackConfi.ReaderConfi.TriggerOn = ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.ReaderConfi.TriggerOn), ConveyorBackConfi.ReaderConfi.TriggerOn);
            ConveyorBackConfi.ReaderConfi.TriggerOff = ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.ReaderConfi.TriggerOff), ConveyorBackConfi.ReaderConfi.TriggerOff);
            ConveyorBackConfi.ReaderConfi.ErrorStr = ConfigHelper.Instance.GetValue(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.ReaderConfi.ErrorStr), ConveyorBackConfi.ReaderConfi.ErrorStr);

            if (ConfigHelper.Instance.IsSave)
            {
                ConfigHelper.Instance.WriteToFile();
            }
        }
        /// <summary>
        /// 设置调宽轴当前位置
        /// </summary>
        /// <param name="module"></param>
        /// 
        /// 
        /// 
        /// 
        /// <param name="pos"></param>
        public void SetWAxisPosition(ConveyorModuleE module
            , float pos)
        {
            switch (module)
            {
                case ConveyorModuleE.Front:
                    ConveyorFrontConfi.WAxisPosition = pos;
                    ConfigHelper.Instance.UpdateContent(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.WAxisPosition), ConveyorFrontConfi.WAxisPosition.ToString("0.00"));
                    break;
                case ConveyorModuleE.Back:
                    ConveyorBackConfi.WAxisPosition = pos;
                    ConfigHelper.Instance.UpdateContent(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.WAxisPosition), ConveyorBackConfi.WAxisPosition.ToString("0.00"));
                    break;
                default: 
                    break;
            }

            ConfigHelper.Instance.WriteToFile();
        }
        /// <summary>
        /// 设置调宽轴校准值
        /// </summary>
        /// <param name="module"></param>
        /// <param name="pos"></param>
        public void SetWAxisCheck(ConveyorModuleE module, float pos)
        {
            switch (module)
            {
                case ConveyorModuleE.Front:
                    ConveyorFrontConfi.WAxisCheck = pos;
                    ConfigHelper.Instance.UpdateContent(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.WAxisCheck), ConveyorFrontConfi.WAxisCheck.ToString());
                    break;
                case ConveyorModuleE.Back:
                    ConveyorBackConfi.WAxisCheck = pos;
                    ConfigHelper.Instance.UpdateContent(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.WAxisCheck), ConveyorBackConfi.WAxisCheck.ToString());
                    break;
                default:
                    break;
            }
            
            ConfigHelper.Instance.WriteToFile();
        }
        /// <summary>
        /// 设置读码器使能状态
        /// </summary>
        /// <param name="module"></param>
        /// <param name="enable"></param>
        public void SetCodeReaderState(ConveyorModuleE module, int enable)
        {
            switch (module)
            {
                case ConveyorModuleE.Front:
                    ConveyorFrontConfi.ReaderConfi.ReaderEnable = enable;
                    ConfigHelper.Instance.UpdateContent(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.ReaderConfi.ReaderEnable), ConveyorFrontConfi.ReaderConfi.ReaderEnable.ToString());
                    break;
                case ConveyorModuleE.Back:
                    ConveyorBackConfi.ReaderConfi.ReaderEnable = enable;
                    ConfigHelper.Instance.UpdateContent(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.ReaderConfi.ReaderEnable), ConveyorBackConfi.ReaderConfi.ReaderEnable.ToString());
                    break;
                default:
                    break;
            }
            
            ConfigHelper.Instance.WriteToFile();
        }
        /// <summary>
        /// 读取读码器使能状态
        /// </summary>
        /// <param name="module"></param>
        /// <param name="enable"></param>
        public void GetCodeReaderState(ConveyorModuleE module, ref int enable)
        {
            switch (module)
            {
                case ConveyorModuleE.Front:
                    enable = ConveyorFrontConfi.ReaderConfi.ReaderEnable;
                    break;
                case ConveyorModuleE.Back:
                    enable = ConveyorBackConfi.ReaderConfi.ReaderEnable;
                    break;
                default:
                    break;
            }
        }
        /// <summary>
        /// 设置轴限位
        /// </summary>
        /// <param name="axis"></param>
        /// <param name="limitN"></param>
        /// <param name="limitP"></param>
        /// <returns></returns>
        public int SetAxisLimit(AxisEnum axis, float limitN, float limitP)
        {
            int iRet = 0;

            switch (axis)
            {
                case AxisEnum.X_Up:
                    XAxisUpConfi.FsLimit = limitP;
                    XAxisUpConfi.RsLimit = limitN;
                    ConfigHelper.Instance.UpdateContent(nameof(XAxisUpConfi), nameof(XAxisUpConfi.FsLimit), XAxisUpConfi.FsLimit.ToString());
                    ConfigHelper.Instance.UpdateContent(nameof(XAxisUpConfi), nameof(XAxisUpConfi.RsLimit), XAxisUpConfi.RsLimit.ToString());
                    break;
                case AxisEnum.Y_Up:
                    YAxisUpConfi.FsLimit = limitP;
                    YAxisUpConfi.RsLimit = limitN;
                    ConfigHelper.Instance.UpdateContent(nameof(YAxisUpConfi), nameof(YAxisUpConfi.FsLimit), YAxisUpConfi.FsLimit.ToString());
                    ConfigHelper.Instance.UpdateContent(nameof(YAxisUpConfi), nameof(YAxisUpConfi.RsLimit), YAxisUpConfi.RsLimit.ToString());
                    break;
                case AxisEnum.X_Down:
                    XAxisDownConfi.FsLimit = limitP;
                    XAxisDownConfi.RsLimit = limitN;
                    ConfigHelper.Instance.UpdateContent(nameof(XAxisDownConfi), nameof(XAxisDownConfi.FsLimit), XAxisDownConfi.FsLimit.ToString());
                    ConfigHelper.Instance.UpdateContent(nameof(XAxisDownConfi), nameof(XAxisDownConfi.RsLimit), XAxisDownConfi.RsLimit.ToString());
                    break;
                case AxisEnum.Y_Down:
                    YAxisDownConfi.FsLimit = limitP;
                    YAxisDownConfi.RsLimit = limitN;
                    ConfigHelper.Instance.UpdateContent(nameof(YAxisDownConfi), nameof(YAxisDownConfi.FsLimit), YAxisDownConfi.FsLimit.ToString());
                    ConfigHelper.Instance.UpdateContent(nameof(YAxisDownConfi), nameof(YAxisDownConfi.RsLimit), YAxisDownConfi.RsLimit.ToString());
                    break;
                case AxisEnum.W_Front:
                    WAxisFrontConfi.FsLimit = limitP;
                    WAxisFrontConfi.RsLimit = limitN;
                    ConfigHelper.Instance.UpdateContent(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.FsLimit), WAxisFrontConfi.FsLimit.ToString());
                    ConfigHelper.Instance.UpdateContent(nameof(WAxisFrontConfi), nameof(WAxisFrontConfi.RsLimit), WAxisFrontConfi.RsLimit.ToString());
                    break;
                case AxisEnum.W_Back1:
                    WAxisBack1Confi.FsLimit = limitP;
                    WAxisBack1Confi.RsLimit = limitN;
                    ConfigHelper.Instance.UpdateContent(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.FsLimit), WAxisBack1Confi.FsLimit.ToString());
                    ConfigHelper.Instance.UpdateContent(nameof(WAxisBack1Confi), nameof(WAxisBack1Confi.RsLimit), WAxisBack1Confi.RsLimit.ToString());
                    break;
                case AxisEnum.W_Back2:
                    WAxisBack2Confi.FsLimit = limitP;
                    WAxisBack2Confi.RsLimit = limitN;
                    ConfigHelper.Instance.UpdateContent(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.FsLimit), WAxisBack2Confi.FsLimit.ToString());
                    ConfigHelper.Instance.UpdateContent(nameof(WAxisBack2Confi), nameof(WAxisBack2Confi.RsLimit), WAxisBack2Confi.RsLimit.ToString());
                    break;
                default:
                    iRet = -1;
                    break;
            }

            ConfigHelper.Instance.WriteToFile();
            return iRet;
        }
        /// <summary>
        /// 获取轴软限位
        /// </summary>
        /// <param name="axis"></param>
        /// <param name="limitN"></param>
        /// <param name="limitP"></param>
        /// <returns></returns>
        public int GetAxisLimit(AxisEnum axis, ref float limitN, ref float limitP)
        {
            switch (axis)
            {
                case AxisEnum.X_Up:
                    limitN = XAxisUpConfi.RsLimit;
                    limitP = XAxisUpConfi.FsLimit;
                    break;
                case AxisEnum.Y_Up:
                    limitN = YAxisUpConfi.RsLimit;
                    limitP = YAxisUpConfi.FsLimit;
                    break;
                case AxisEnum.X_Down:
                    limitN = XAxisDownConfi.RsLimit;
                    limitP = XAxisDownConfi.FsLimit;
                    break;
                case AxisEnum.Y_Down:
                    limitN = YAxisDownConfi.RsLimit;
                    limitP = YAxisDownConfi.FsLimit;
                    break;
                case AxisEnum.W_Front:
                    limitN = WAxisFrontConfi.RsLimit;
                    limitP = WAxisFrontConfi.FsLimit;
                    break;
                case AxisEnum.W_Back1:
                    limitN = WAxisBack1Confi.RsLimit;
                    limitP = WAxisBack1Confi.FsLimit;
                    break;
                case AxisEnum.W_Back2:
                    limitN = WAxisBack2Confi.RsLimit;
                    limitP = WAxisBack2Confi.FsLimit;
                    break;
                default:
                    break;
            }

            return 0;
        }
        /// <summary>
        /// 设置相机标定起点
        /// </summary>
        /// <param name="module"></param>
        /// <param name="xpos"></param>
        /// <param name="ypos"></param>
        public int SetCameraCalibration(ConveyorModuleE conveyorMdl, CameraModuleE cameraMdl, float xpos, float ypos)
        {
            if (conveyorMdl == ConveyorModuleE.Front && cameraMdl == CameraModuleE.Upper)
            {
                if ((LineDirectionE)ConveyorFrontConfi.Direction == LineDirectionE.Left)
                {
                    CameraUpConfi.calibration.FrontLStartX = xpos; 
                    CameraUpConfi.calibration.FrontLStartY = ypos;
                    ConfigHelper.Instance.UpdateContent(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.FrontLStartX), CameraUpConfi.calibration.FrontLStartX.ToString());
                    ConfigHelper.Instance.UpdateContent(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.FrontLStartY), CameraUpConfi.calibration.FrontLStartY.ToString());
                }
                else
                {
                    CameraUpConfi.calibration.FrontRStartX = xpos;
                    CameraUpConfi.calibration.FrontRStartY = ypos;
                    ConfigHelper.Instance.UpdateContent(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.FrontRStartX), CameraUpConfi.calibration.FrontRStartX.ToString());
                    ConfigHelper.Instance.UpdateContent(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.FrontRStartY), CameraUpConfi.calibration.FrontRStartY.ToString());
                }
            }

            if (conveyorMdl == ConveyorModuleE.Front && cameraMdl == CameraModuleE.Lower)
            {
                if ((LineDirectionE)ConveyorFrontConfi.Direction != LineDirectionE.Left)
                {
                    CameraDownConfi.calibration.FrontLStartX = xpos;
                    CameraDownConfi.calibration.FrontLStartY = ypos;
                    ConfigHelper.Instance.UpdateContent(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.FrontLStartX), CameraDownConfi.calibration.FrontLStartX.ToString());
                    ConfigHelper.Instance.UpdateContent(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.FrontLStartY), CameraDownConfi.calibration.FrontLStartY.ToString());
                }
                else
                {
                    CameraDownConfi.calibration.FrontRStartX = xpos;
                    CameraDownConfi.calibration.FrontRStartY = ypos;
                    ConfigHelper.Instance.UpdateContent(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.FrontRStartX), CameraDownConfi.calibration.FrontRStartX.ToString());
                    ConfigHelper.Instance.UpdateContent(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.FrontRStartY), CameraDownConfi.calibration.FrontRStartY.ToString());
                }
            }

            if (conveyorMdl == ConveyorModuleE.Back && cameraMdl == CameraModuleE.Upper)
            {
                if ((LineDirectionE)ConveyorBackConfi.Direction == LineDirectionE.Left)
                {
                    CameraUpConfi.calibration.BackLStartX = xpos;
                    CameraUpConfi.calibration.BackLStartY = ypos;
                    ConfigHelper.Instance.UpdateContent(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.BackLStartX), CameraUpConfi.calibration.BackLStartX.ToString());
                    ConfigHelper.Instance.UpdateContent(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.BackLStartY), CameraUpConfi.calibration.BackLStartY.ToString());
                }
                else
                {
                    CameraUpConfi.calibration.BackRStartX = xpos;
                    CameraUpConfi.calibration.BackRStartY = ypos;
                    ConfigHelper.Instance.UpdateContent(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.BackRStartX), CameraUpConfi.calibration.BackRStartX.ToString());
                    ConfigHelper.Instance.UpdateContent(nameof(CameraUpConfi), nameof(CameraUpConfi.calibration.BackRStartY), CameraUpConfi.calibration.BackRStartY.ToString());
                }
            }

            if (conveyorMdl == ConveyorModuleE.Back && cameraMdl == CameraModuleE.Lower)
            {
                if ((LineDirectionE)ConveyorBackConfi.Direction != LineDirectionE.Left)
                {
                    CameraDownConfi.calibration.BackLStartX = xpos;
                    CameraDownConfi.calibration.BackLStartY = ypos;
                    ConfigHelper.Instance.UpdateContent(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.BackLStartX), CameraDownConfi.calibration.BackLStartX.ToString());
                    ConfigHelper.Instance.UpdateContent(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.BackLStartY), CameraDownConfi.calibration.BackLStartY.ToString());
                }
                else
                {
                    CameraDownConfi.calibration.BackRStartX = xpos;
                    CameraDownConfi.calibration.BackRStartY = ypos;
                    ConfigHelper.Instance.UpdateContent(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.BackRStartX), CameraDownConfi.calibration.BackRStartX.ToString());
                    ConfigHelper.Instance.UpdateContent(nameof(CameraDownConfi), nameof(CameraDownConfi.calibration.BackRStartY), CameraDownConfi.calibration.BackRStartY.ToString());
                }
            }

            ConfigHelper.Instance.WriteToFile();
            return 0;
        }
        /// <summary>
        /// 获取相机标定起点
        /// </summary>
        /// <param name="conveyorMdl"></param>
        /// <param name="cameraMdl"></param>
        /// <param name="xpos"></param>
        /// <param name="ypos"></param>
        /// <returns></returns>
        public int GetCameraCalibration(ConveyorModuleE conveyorMdl, CameraModuleE cameraMdl, ref float xpos, ref float ypos)
        {
            if (conveyorMdl == ConveyorModuleE.Front && cameraMdl == CameraModuleE.Upper)
            {
                if ((LineDirectionE)ConveyorFrontConfi.Direction == LineDirectionE.Left)
                {
                    xpos = CameraUpConfi.calibration.FrontLStartX;
                    ypos = CameraUpConfi.calibration.FrontLStartY;
                }
                else
                {
                    xpos = CameraUpConfi.calibration.FrontRStartX;
                    ypos = CameraUpConfi.calibration.FrontRStartY;
                }
            }

            if (conveyorMdl == ConveyorModuleE.Front && cameraMdl == CameraModuleE.Lower)
            {
                if ((LineDirectionE)ConveyorFrontConfi.Direction != LineDirectionE.Left)
                {
                    xpos = CameraDownConfi.calibration.FrontLStartX;
                    ypos = CameraDownConfi.calibration.FrontLStartY;
                }
                else
                {
                    xpos = CameraDownConfi.calibration.FrontRStartX;
                    ypos = CameraDownConfi.calibration.FrontRStartY;
                }
            }

            if (conveyorMdl == ConveyorModuleE.Back && cameraMdl == CameraModuleE.Upper)
            {
                if ((LineDirectionE)ConveyorBackConfi.Direction == LineDirectionE.Left)
                {
                    xpos = CameraUpConfi.calibration.BackLStartX;
                    ypos = CameraUpConfi.calibration.BackLStartY;
                }
                else
                {
                    xpos = CameraUpConfi.calibration.BackRStartX;
                    ypos = CameraUpConfi.calibration.BackRStartY;
                }
            }

            if (conveyorMdl == ConveyorModuleE.Back && cameraMdl == CameraModuleE.Lower)
            {
                if ((LineDirectionE)ConveyorBackConfi.Direction != LineDirectionE.Left)
                {
                    xpos = CameraDownConfi.calibration.BackLStartX;
                    ypos = CameraDownConfi.calibration.BackLStartY;
                }
                else
                {
                    xpos = CameraDownConfi.calibration.BackRStartX;
                    ypos = CameraDownConfi.calibration.BackRStartY;
                }
            }

            return 0;
        }
        /// <summary>
        /// 设置轨道模组超时
        /// </summary>
        /// <param name="module"></param>
        /// <param name="timeout"></param>
        /// <returns></returns>
        public int SetConveyorTimeout(ConveyorModuleE module, int timeout)
        {
            switch (module)
            {
                case ConveyorModuleE.Front:
                    ConveyorFrontConfi.Timeout = timeout;
                    ConfigHelper.Instance.UpdateContent(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.Timeout), ConveyorFrontConfi.Timeout.ToString());
                    break;
                case ConveyorModuleE.Back:
                    ConveyorBackConfi.Timeout = timeout;
                    ConfigHelper.Instance.UpdateContent(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.Timeout), ConveyorBackConfi.Timeout.ToString());
                    break;
                default:
                    break;
            }

            ConfigHelper.Instance.WriteToFile();
            return 0;
        }
        /// <summary>
        /// 获取轨道模组超时
        /// </summary>
        /// <param name="module"></param>
        /// <param name="timeout"></param>
        /// <returns></returns>
        public int GetConveyorTimeout(ConveyorModuleE module, ref int timeout)
        {
            switch (module)
            {
                case ConveyorModuleE.Front:
                    timeout = ConveyorFrontConfi.Timeout;
                    break;
                case ConveyorModuleE.Back:
                    timeout = ConveyorFrontConfi.Timeout;
                    break;
                default:
                    break;
            }
            return 0;
        }
        /// <summary>
        /// 设置相机模组超时
        /// </summary>
        /// <param name="module"></param>
        /// <param name="timeout"></param>
        /// <returns></returns>
        public int SetCameraTimeout(CameraModuleE module, int timeout)
        {
            switch (module)
            {
                case CameraModuleE.Upper:
                    CameraUpConfi.Timeout = timeout;
                    ConfigHelper.Instance.UpdateContent(nameof(CameraUpConfi), nameof(CameraUpConfi.Timeout), CameraUpConfi.Timeout.ToString());
                    break;
                case CameraModuleE.Lower:
                    CameraDownConfi.Timeout = timeout;
                    ConfigHelper.Instance.UpdateContent(nameof(CameraDownConfi), nameof(CameraDownConfi.Timeout), CameraDownConfi.Timeout.ToString());
                    break;
                default:
                    break;
            }
            return 0;
        }
        /// <summary>
        /// 获取相机模组超时
        /// </summary>
        /// <param name="module"></param>
        /// <param name="timeout"></param>
        /// <returns></returns>
        public int GetCameraTimeout(CameraModuleE module, ref int timeout)
        {
            switch (module)
            {
                case CameraModuleE.Upper:
                    timeout = CameraUpConfi.Timeout;
                    break;
                case CameraModuleE.Lower:
                    timeout = CameraDownConfi.Timeout;
                    break;
                default:
                    break;
            }
            return 0;
        }
        /// <summary>
        /// 轨道工作模式
        /// </summary>
        /// <param name="workMode">0-左进右出 1-右进左出 2-左进左出 3-右进右出</param>
        /// <returns></returns>
        public int SetConveyorWorkMode(ConveyorModuleE module, int workMode)
        {
            int LineMode = 0;
            int Direction = 0;
            switch (workMode)
            {
                case 0:
                    LineMode = 0;
                    Direction = 0;
                    break;
                case 1:
                    LineMode = 0;
                    Direction = 1;
                    break;
                case 2:
                    LineMode = 1;
                    Direction = 0;
                    break;
                case 3:
                    LineMode = 1;
                    Direction = 1;
                    break;
                default:
                    break;
            }

            if (module == ConveyorModuleE.Front)
            {
                ConfigHelper.Instance.UpdateContent(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.LineMode), LineMode.ToString());
                ConfigHelper.Instance.UpdateContent(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.Direction), Direction.ToString());
            }

            if (module == ConveyorModuleE.Back)
            {
                ConfigHelper.Instance.UpdateContent(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.LineMode), LineMode.ToString());
                ConfigHelper.Instance.UpdateContent(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.Direction), Direction.ToString());
            }

            ConfigHelper.Instance.WriteToFile();
            return 0;
        }
        /// <summary>
        /// 获取轨道工作模式
        /// </summary>
        /// <param name="module"></param>
        /// <param name="workMode"></param>
        /// <returns></returns>
        public int GetConveyorWorkMode(ConveyorModuleE module, ref int workMode)
        {
            if (module == ConveyorModuleE.Front)
            {
                workMode = ConveyorFrontConfi.Direction == 0 ? 0 : 1;
                workMode |= ConveyorFrontConfi.LineMode == 0 ? 0 : 1 << 1;
            }

            if (module == ConveyorModuleE.Back)
            {
                workMode = ConveyorBackConfi.Direction == 0 ? 0 : 1;
                workMode |= ConveyorBackConfi.LineMode == 0 ? 0 : 1 << 1;
            }
            return 0;
        }
        /// <summary>
        /// 设置轨道检测结果模式
        /// </summary>
        /// <param name="module"></param>
        /// <param name="workMode"></param>
        /// <returns></returns>
        public int SetConveyorSmemaMode(ConveyorModuleE module, int smemaMode)
        {
            if (module == ConveyorModuleE.Front)
            {
                ConfigHelper.Instance.UpdateContent(nameof(ConveyorFrontConfi), nameof(ConveyorFrontConfi.SmemaMode), smemaMode.ToString());
            }

            if (module == ConveyorModuleE.Back)
            {
                ConfigHelper.Instance.UpdateContent(nameof(ConveyorBackConfi), nameof(ConveyorBackConfi.SmemaMode), smemaMode.ToString());
            }

            ConfigHelper.Instance.WriteToFile();
            return 0;
        }
    }

    public class GrabPointConfig
    {
        /// <summary>
        /// X位置
        /// </summary>
        public float PosX = 0;
        /// <summary>
        /// Y位置
        /// </summary>
        public float PosY = 0;
        /// <summary>
        /// X长度
        /// </summary>
        public float LenX = 0;
        /// <summary>
        /// Y长度
        /// </summary>
        public float LenY = 0;
        /// <summary>
        /// 点位类型
        /// </summary>
        public GrabPositionTypeE PositionType = GrabPositionTypeE.Normal;
        /// <summary>
        /// 光源类型
        /// </summary>
        public GrabLightTypeE LightType = GrabLightTypeE.RGBLight;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="posX"></param>
        /// <param name="posY"></param>
        /// <param name="lenX"></param>
        /// <param name="lenY"></param>
        /// <param name="lightType"></param>
        public GrabPointConfig(float posX, float posY, float lenX, float lenY,
            GrabPositionTypeE positionType = GrabPositionTypeE.Normal, GrabLightTypeE lightType = GrabLightTypeE.None)
        {
            PosX = posX; 
            PosY = posY; 
            LenX = lenX;
            LenY = lenY;
            PositionType = positionType;
            LightType = lightType;
        }
    }
}
